package com.example.myapplication.adapter

import android.widget.BaseAdapter
import android.widget.CheckBox
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.myapplication.R
import com.example.myapplication.entity.CarGoods

class Car_Adapter(list:ArrayList<CarGoods.cargood>):BaseQuickAdapter<CarGoods.cargood, BaseViewHolder>(R.layout.car_item,list) {
    override fun convert(holder: BaseViewHolder, item: CarGoods.cargood) {
        Glide.with(mContext).load(item.car_path).into(holder.getView(R.id.car_img))
        holder.setText(R.id.car_food_color,"颜色："+item.shop_color)
        holder.setText(R.id.car_good_name,""+item.shop_name)
        holder.setText(R.id.car_food_num,""+item.shop_num)
        holder.setText(R.id.car_food_size,"磨损："+item.shop_size)
        holder.setText(R.id.car_food_price,"价格："+item.shop_price)

        holder.getView<CheckBox>(R.id.car_food_check).isChecked = item.ischecked
        holder.addOnClickListener(R.id.car_img)
            .addOnClickListener(R.id.car_add)
            .addOnClickListener(R.id.car_delete)
            .addOnClickListener(R.id.car_food_check)



    }


}